/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-12-04     86159       the first version
 */
#ifndef APPLICATIONS_MAILBOX_H_
#define APPLICATIONS_MAILBOX_H_
#include <rtdef.h>
#include<rtthread.h>
#include<rtdbg.h>
#include<errno.h>

#define THREAD_PRIORITY      10
#define THREAD_TIMESLICE     5

/* 邮箱控制块 */
static struct rt_mailbox mb;
/* 用于放邮件的内存池 */
static char mb_pool[128];

static char mb_str1[] = "I'm a mail!";
static char mb_str2[] = "this is another mail!";
static char mb_str3[] = "over";

ALIGN(RT_ALIGN_SIZE);
static char thread1_stack[1024];
static struct rt_thread thread1;
static char thread2_stack[1024];
static struct rt_thread thread2;
static void thread1_entry(void *parameter);
static void thread2_entry(void *parameter);
int mailbox_sample(void);

#endif /* APPLICATIONS_MAILBOX_H_ */
